import java.util.Scanner;

public class Main {
  public static int good(int a){
    int t=1;
    while(a!=0){
      int x=a%10;
      if(t%2==1){
         if(x%2==0)
          return 0;
      }else{
        if(x%2==1)
          return 0;
      }
      a/=10;
      t++;
    }
    return 1;
  }

  public static void main(String[] args){
      Scanner sc=new Scanner(System.in);
      int n=sc.nextInt();//n<=10^7
      int count=0;
      for(int i=1;i<=n;i++){
      if(good(i)==1){
        count++;
      }
    }
    System.out.println(count);
  }
}